//
//  DataBase.h
//  BookSale
//
//  Created by dlios on 15-3-10.
//  Copyright (c) 2015年 dlios. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "YoungBook.h"

@interface DataBase : NSObject
//创建单例
+ (instancetype)shareDataBaseHandle;
//打开数据库
- (void)openDB;

//创建总数据库
- (void)createAllTable;
//插入总数据库
- (void)insertAll:(YoungBook *)book number:(NSInteger)number;
//查询总数据库
- (NSMutableArray *)selectAll;


//创建我的收藏
- (void)createCollectionTable;
//插入我的收藏
- (void)insertCollection:(YoungBook *)book number:(NSInteger)number;
//更改我的收藏
- (void)updateCollection:(YoungBook *)youngBook number:(NSInteger)number;
//查询我的收藏
- (NSMutableArray *)selectCollection;
//删除我的收藏
- (void)deleteCollection:(NSInteger)number;

//创建青春文学表
- (void)createYoungTable;
//插入青春文学
- (void)insertYoungBook:(YoungBook *)book number:(NSInteger)number;
//更改青春文学
- (void)updateYoungBook:(YoungBook *)youngBook number:(NSInteger)number;
//查询青春文学
- (NSMutableArray *)selectYoungBook;
//删除青春文学
- (void)deleteYoungBook:(NSInteger)number;


//创建小说表
- (void)createNovelTable;
//插入小说
- (void)insertNovel:(YoungBook *)book number:(NSInteger)number;
//查询小说
- (NSMutableArray *)selectNovel;
//删除小说
- (void)deleteNovel:(NSInteger)number;

//创建科普
- (void)createScienceTable;
//插入科普
- (void)insertScience:(YoungBook *)book number:(NSInteger)number;
//查询科普
- (NSMutableArray *)selectScience;
//删除科普
- (void)deleteScience:(NSInteger)number;

//创建社科
- (void)createSocialTable;
//插入社科
- (void)insertSocial:(YoungBook *)book number:(NSInteger)number;
//查询社科
- (NSMutableArray *)selectSocial;
//删除社科
- (void)deleteSocial:(NSInteger)number;

//创建管理
- (void)createManagerTable;
//插入管理
- (void)insertManager:(YoungBook *)book number:(NSInteger)number;
//查询管理
- (NSMutableArray *)selectManager;
//删除管理
- (void)deleteManager:(NSInteger)number;

//创建生活
- (void)createLifeTable;
//插入生活
- (void)insertLife:(YoungBook *)book number:(NSInteger)number;
//查询生活
- (NSMutableArray *)selectLife;
//删除生活
- (void)deleteLife:(NSInteger)number;

//创建文学
- (void)createLiteratureTable;
//插入文学
- (void)insertLiterature:(YoungBook *)book number:(NSInteger)number;
//查询文学
- (NSMutableArray *)selectLiterature;
//删除文学
- (void)deleteLiterature:(NSInteger)number;

//创建艺术
- (void)createArtTable;
//插入艺术
- (void)insertArt:(YoungBook *)book number:(NSInteger)number;
//查询艺术
- (NSMutableArray *)selectArt;
//删除艺术
- (void)deleteArt:(NSInteger)number;


//清除缓存
- (void)DropTable;


@end
